<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>

<xsl:template match="latest">

	<xsl:for-each select="galleryEntry[@openingsmall=/latest/@random]">
			<xsl:choose>
				<xsl:when test='@openingsmall and string-length(@opening) = 0'>
					<a href="/gallery/latest.aspx"><img border="0" src="/imgs/gallery/thumb/{@openingsmall}"/></a>
				</xsl:when>
				<xsl:when test='@openingsmall'>
					<a href="/gallery/latest.aspx"><img border="0" src="/imgs/gallery/opening/{@openingsmall}"/></a>
				</xsl:when>
				<xsl:otherwise>
					<td align="right" width="25%" rowspan="2">
						<img src="/imgs/gallery/empty.gif"/>
					</td>
				</xsl:otherwise>
			</xsl:choose>
	<div class="body" style="padding-top:5px;padding-bottom:15px;">
	</div>
	
	</xsl:for-each>


</xsl:template>

</xsl:stylesheet>
